/* You can add global styles to this file, and also import other style files */

/* 修改左边菜单收缩后的图标上下距离 */
@media (min-width: @mobile-min) {
  @{alain-default-prefix}__collapsed {
    .@{sidebar-nav-prefix-cls}:not(.@{sidebar-nav-prefix-cls}__sub) {
      .@{sidebar-nav-prefix-cls}__item {
        border: none;

        &-link {
          justify-content: center;
          padding: (@layout-gutter * 1) 0;
        }
      }
    }
  }
}

// 工作区缺省的内边距
@alain-default-content-padding: 0;

// 工具栏高度
@mt-toolbar-height: 40px;

// ST表格内边距
@st-padding: 10px;

/* 通用Flex布局 */
.mt-flex {
  display: flex;
  overflow: hidden;
}

// 垂直Flex布局（需要自己设定高度，大部分情况是height: 100%;）
.mt-flex-column {
  .mt-flex;

  flex-direction: column;
  width: 100%;
}

// 水平Flex布局（需要自己设定宽度，大部分情况是width: 100%;）
.mt-flex-row {
  .mt-flex;

  flex-direction: row;
  height: 100%;
}

/* ST表格 */
.st {
  height: 100%;
}

/* 通用nz表格 */
nz-table {
  height: 100%;
  padding: 0 @st-padding @st-padding @st-padding;

  // 表头
  // .ant-table-header {
  //   background: #ededed !important;
  //   border-top: 4px solid @primary-color;

  //   // 表头标题
  //   .ant-table-thead tr th {
  //     color: @primary-color;
  //     font-weight: bold;
  //     font-size: 15px;
  //   }
  // }

  // 表格重新按flex布局
  nz-spin {
    height: 100%;

    .ant-spin-container {
      .mt-flex-column;

      height: 100%;

      // 表格
      .ant-table {
        flex: 1 1 auto;
        order: 1;
        height: 150px;
        .mt-flex-column;

        .ant-table-content {
          flex: 1 1 auto;
          height: 130px;
        }

        // 继续向下flex
        .ant-table-scroll {
          .mt-flex-column;

          height: 100%;

          // 表头
          .ant-table-header {
            flex: none;
            order: 1;
            // overflow: hidden;
            // margin-bottom: 0 !important;
          }

          // 内容(最终需要它动态滚动)
          .ant-table-body {
            flex: 1 1 auto;
            order: 2;
            height: 100px;
          }

          // 没有数据时的占位图标
          .ant-table-placeholder {
            flex: 1 1 auto;
            order: 3;
            border-top: 0;
          }
        }
      }

      // 分页栏
      nz-pagination {
        order: 2;

        .ant-table-pagination.ant-pagination {
          margin-bottom: 0;
        }
      }
    }
  }

  // 紧凑行
  .ant-table-content>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-scroll>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-scroll>.ant-table-body>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-left>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-right>.ant-table-header>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-left>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-fixed-right>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-thead>tr>th,
  .ant-table-content>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-body>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-scroll>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-scroll>.ant-table-body>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-left>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-right>.ant-table-header>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-left>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-tbody>tr>td,
  .ant-table-content>.ant-table-fixed-right>.ant-table-body-outer>.ant-table-body-inner>table>.ant-table-tbody>tr>td {
    padding: 5px 8px !important;
  }

  // 选中行样式
  .ant-table-thead>tr.ant-table-row-hover:not(.ant-table-expanded-row)>td,
  .ant-table-tbody>tr.ant-table-row-hover:not(.ant-table-expanded-row)>td,
  .ant-table-thead>tr:hover:not(.ant-table-expanded-row)>td,
  .ant-table-tbody>tr:hover:not(.ant-table-expanded-row)>td {
    color: @primary-color;
    background: tint(@primary-color, 96%);
  }
}

/* 弹窗下的表格 */
.ant-modal-body>nz-table,
.ant-modal-body>*>nz-table {
  padding: 0;

  .ant-table {
    height: 100%;

    .ant-table-content {
      height: 100%;

      .ant-table-body {
        height: 100%;
      }
    }
  }
}

// 面板组件上的小工具栏
.matech-panel-toolbar {
  background-color: white;
}

/* 通用搜索工具条表单 */
.matech-toolbar {
  padding: 0 @st-padding / 2 0 @st-padding / 2;
  line-height: @mt-toolbar-height;

  .ant-form-item {
    display: flex;
    justify-content: flex-end;

    // 文字不要设置nzSpan宽度，间隔30px
    .ant-form-item-label {
      padding-left: 30px;
    }

    // 第一个元素不用间隔
    .ant-form-item-label:first-child {
      padding-left: 0;
    }

    .ant-form-item-control-wrapper {

      // 组合文本框
      .ant-input-affix-wrapper {
        width: 100%;
        margin-top: -5px;
        vertical-align: middle;
      }

      // 搜索按钮所在formcontrol
      &.btn-search {
        width: auto;

        button {
          margin-left: 20px;
        }
      }
    }
  }

  // 最后一个表单元素
  .ant-form-item:last-child {
    margin-bottom: 0;
  }
}

/* angular-split页面布局 */
.as-split-area {
  height: 1px;

  >.sider-trigger {
    bottom: 0;
    width: 100%;
    height: 42px;
    color: #002140;
    line-height: 42px;
    text-align: center;
    background: #fafafa;
    border: 1px solid #fafafa;
    cursor: pointer;
    transition: all 0.2s;
  }
}

.as-split-area.flex-fixed {
  flex: none !important;
  height: auto;
  overflow: hidden !important;
}

/* 水平Tab选项卡flex布局 */
.ant-tabs.ant-tabs-top {
  .mt-flex-column;

  height: 100%;

  .ant-tabs-content {
    flex: 1 1 auto;

    .ant-tabs-tabpane.ant-tabs-tabpane-active {
      height: 100%;
    }
  }
}

.alain-default__content>router-outlet+* {
  flex: 1 1 auto;
  height: 100px;
}

/**
  *不可点击
  */
.unclickable {
  pointer-events: none;
}

.light-border {
  border: solid 1px #e8e8e8;
}

/**
 *测试更改自定义下拉组件样式
 */
.self-selector {
  .ant-select-selection {
    width: 115px !important;
  }
}

.self-selector-min {
  .ant-select-selection {
    width: 100px !important;
  }
}
